<?php

use Illuminate\Http\Request;

/*
|--------------------------------------------------------------------------
| API Routes
|--------------------------------------------------------------------------
|
| Here is where you can register API routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| is assigned the "api" middleware group. Enjoy building your API!
|
*/

Route::group(['namespace' => 'Api', 'middleware' => 'api_check'], function () {
    // v1
    Route::group(['namespace' => 'V1', 'prefix' => 'v1'], function () {
        Route::post('test', 'DemoController@test'); // url: api/v1/test

        // 公共服务
        Route::post('verification-code', 'PublicController@getVerificationCode'); // 获取验证码
        Route::post('login', 'PublicController@loginByMsgCode'); // 货主/车主登录
        Route::post('register', 'PublicController@registerByMsgCode'); // 货主/车主注册
        Route::post('login-register', 'PublicController@loginOrRegister'); // 车主注册/登录

        Route::post('upload', 'PublicController@uploadFile'); // 文件上传
        Route::post('city/childs', 'PublicController@getCityChilds'); // 获取城市的下一级信息
        Route::post('city/parent', 'PublicController@getCityParent'); // 获取城市的上级信息
        Route::post('msg/list', 'MessageController@msgList'); // 消息列表
        Route::post('msg/del-system-msg', 'MessageController@delSystemMsg'); // 清空系统消息
        Route::post('msg/reply-msg', 'MessageController@replyMsg'); // 发送、回复消息
        Route::post('msg/read-msg', 'MessageController@readMsg'); // 消息已读

        /**司机接口**/
        // 获取订单
        Route::post('driver/order-list-today', 'OrderController@getTodayOrderListForDrivers'); // 司机查看今日货源列表
        Route::post('driver/order-list-subscribed', 'OrderController@getSubscribedOrderListForDrivers'); // 司机查看订阅货源列表
        Route::post('driver/order-detail', 'OrderController@getOrderDetailForDrivers'); // 司机查看货源详情

        // 司机用户
        Route::post('driver/get-driver-profile', 'DriversController@getDriverProfile'); // 获取司机信息
        Route::post('driver/identity-verify', 'DriversController@identityVerify'); // 司机身份认证
        Route::post('driver/car-verify', 'DriversController@carVerify'); // 司机身份认证
        Route::post('driver/verify-info', 'DriversController@getVerifyInfo'); // 获取司机认证资料
        Route::post('driver/broadcast-car-status', 'DriversController@broadcastCarStatus'); // 车辆状态上报

        // 司机银行卡信息
        Route::post('driver/bank-list', 'DriverBankController@bankList'); // 司机银行卡信息列表
        Route::post('driver/bank-add', 'DriverBankController@addBank'); // 添加司机银行卡操作
        Route::post('driver/bank-edit', 'DriverBankController@editBank'); // 编辑司机银行卡操作
        Route::post('driver/bank-delete', 'DriverBankController@deleteBank'); // 删除司机银行卡操作

        // 运货相关
        Route::post('driver/shipping-list', 'ShippingController@shippingList'); // 运货列表展示
        Route::post('driver/shipping-detail', 'ShippingController@shippingDetail'); // 运货详情展示
        Route::post('driver/shipping-arrive-src', 'ShippingController@arriveSrc'); // 司机到达发货地
        Route::post('driver/shipping-confirm-load', 'ShippingController@confirmLoad'); // 司机已确认装货
        Route::post('driver/shipping-load', 'ShippingController@load'); // 司机完成装货磅单上传
        Route::post('driver/shipping-confirm-unload', 'ShippingController@confirmUnload'); // 司机已确认卸货
        Route::post('driver/shipping-unload', 'ShippingController@unload'); // 卸货完成
        Route::post('driver/shipping/confirm-amount', 'ShippingController@confirmAmount'); // 司机确认金额和银行卡
        Route::post('driver/shipping-payment', 'ShippingController@pay'); // 司机确认支付

        // 司机订阅线路相关
        Route::post('driver/route-list', 'DriverRoutesController@routeList'); // 订阅线路列表展示
        Route::post('driver/route-detail', 'DriverRoutesController@routeDetail'); // 订阅线路列表展示
        Route::post('driver/route-add', 'DriverRoutesController@addRoute'); // 添加订阅线路
        Route::post('driver/route-edit', 'DriverRoutesController@editRoute'); // 编辑订阅线路
        Route::post('driver/route-delete', 'DriverRoutesController@deleteRoute'); // 删除订阅线路

        // 支付
        Route::post('pay/app/msg-fee', 'PayController@msgFeePayByApp'); // app支付
        Route::post('pay/mini/msg-fee', 'PayController@msgFeePayByMiniapp'); // 小程序支付
        Route::post('pay/result-query', 'PayController@queryPayResult'); // 微信支付结果查询
        Route::post('pay/alipay/return', 'PayController@alipayReturnVerify'); // 支付宝支付同步结果验证
        Route::post('driver/cancel-shipping', 'ShippingController@cancelShippingByDrivers'); // 司机违约订单  sql

        /**货主接口*/
        // 认证接口
        Route::post('owner/identity-verify', 'OwnerController@identityVerify'); // 货主实名认证
        Route::post('owner/company-verify', 'OwnerController@companyVerify'); // 货主企业认证
        Route::post('owner/verify-info', 'OwnerController@getVerifyInfo'); // 获取货主认证资料
        Route::post('owner/info', 'OwnerController@getInfo'); // 获取货主认证状态

        // 线路
        Route::post('owner/route-list', 'OwnerRoutesController@routeList'); // 常用发货线路列表
        //Route::post('owner/route-add', 'OwnerRoutesController@addRoute'); // 添加发货线路

        // 员工接口
        Route::post('member/list', 'MemberController@list'); //员工列表
        Route::post('member/add', 'MemberController@addMember'); // 新增员工
        Route::post('member/edit', 'MemberController@editMember'); // 编辑员工
        Route::post('member/unbind-relation', 'MemberController@unbindRelation'); // 解绑和雇主的关系

        // 车辆
        Route::post('car/site-list', 'CarController@siteList'); // 车辆型号配置列表
        Route::post('car/add-scheme', 'CarController@addScheme'); // 新增车辆方案

        // 通知
        Route::post('msg/notice-list', 'MessageController@getNoticeList'); // 通知列表
        Route::post('msg/add-notice', 'MessageController@addNotice'); // 新增通知
        Route::post('order/driver-list', 'OrderController@getOrderDriverList'); // 获取订单对应的司机信息

        // 发货 & 订单
        Route::post('order/sender', 'OrderController@getUsedSender'); // 常用发货人
        Route::post('order/receiver', 'OrderController@getUsedReceiver'); // 常用收货人
        Route::post('order/add', 'OrderController@createOrder'); // 生成订单
        Route::post('order/owner-list', 'OrderController@ownerOrderList'); // 订单列表
        Route::post('order/schedule', 'OrderController@orderSchedule'); // 订单进度
        Route::post('order/info', 'OrderController@ownerOrderInfo'); // 订单详情
        Route::post('order/wait-load-list', 'OrderController@waitLoadCarList'); // 待装货
        Route::post('order/in-transit-list', 'OrderController@inTransitCarList'); // 已装货 运输中
        Route::post('order/wait-pay-list', 'OrderController@waitPayCarList'); // 待结算
        Route::post('order/complete-list', 'OrderController@completeCarList'); // 已完成

        // 装货 & 卸货
        Route::post('owner/confirm-load', 'OwnerController@confirmLoad'); // 发货人装货确认
        Route::post('owner/confirm-unload', 'OwnerController@confirmUnload'); // 收货人卸货确认

        // 油卡
        Route::post('card/list', 'CardController@cardList'); // 获取油卡列表

        // 支付 & 费用计算
        Route::post('owner/shipping/loss', 'OwnerController@lossCalculate'); // 扣损计算
        Route::post('owner/shipping/loss-confirm', 'OwnerController@confirmLossFee'); // 扣损确定
        Route::post('owner/shipping/amount', 'OwnerController@amountCalculate'); // 运单费用计算
        Route::post('owner/shipping/amount-confirm', 'OwnerController@confirmShippingAmount'); // 运单费用确定
        Route::post('owner/shipping/after-amount-confirm', 'OwnerController@afterConfirmShippingAmount'); // 货主确认运单费用后的数据展示
        Route::post('owner/shipping/pay-list', 'OwnerController@payList'); // 财务管理
        Route::post('owner/shipping/export-pay-result', 'OwnerController@exportPayResult'); // 导出财务信息
        Route::post('owner/shipping/export-list', 'OwnerController@exportList'); // 导出历史记录信息
        Route::post('owner/shipping/pay-done', 'OwnerController@payDone'); // 财务支付完成

        /****  sql新增 货主审核司机违约运单  begin**/
        Route::post('owner/shipping/exa-cancel-status', 'OwnerController@examineCancelStatus'); // 货主审核司机违约运单
        /****  sql新增 司机违约运单需要货主审核功能  end**/
        //** sql 货主银行卡信息 */
        Route::post('owner/bank-list', 'OwnerBankController@bankList'); //  列表
        Route::post('owner/bank-add', 'OwnerBankController@addBank'); // 添加
        Route::post('owner/bank-edit', 'OwnerBankController@editBank'); // 编辑
        Route::post('owner/bank-delete', 'OwnerBankController@deleteBank'); // 删除
    });

});